<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__static/lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="__static/css/public.css" media="all">
    <link rel="stylesheet" href="__static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
    <style>
        .layui-form-item .layui-input-company {width: auto;padding-right: 10px;line-height: 38px;}
    </style>
</head>
<body>

<div class="layuimini-container">
    <div class="layuimini-main">
        <blockquote class="layui-elem-quote">
            <p><i class="fa fa-wechat"></i> 企业微信配置</p>
        </blockquote>

        <div class="layui-form layuimini-form">
            <div class="layui-form-item">
                <label class="layui-form-label">企业ID</label>
                <div class="layui-input-block">
                    <input type="text" value="{$qywx.corp_id|default=''}" class="layui-input layui-disabled">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">应用ID</label>
                <div class="layui-input-block">
                    <input type="text" value="{$qywx.agent_id|default=''}" class="layui-input layui-disabled">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">Secret</label>
                <div class="layui-input-block">
                    <input type="text" value="{$qywx.secret|default=''}" class="layui-input layui-disabled">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">跳转URI</label>
                <div class="layui-input-block">
                    <input type="text" value="{$qywx.redirect_uri|default=''}" class="layui-input layui-disabled">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">STATE</label>
                <div class="layui-input-block">
                    <input type="text" value="{$qywx.state|default=''}" class="layui-input layui-disabled">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">时效</label>
                <div class="layui-input-inline">
                    <input type="text" value="{$qywx.expire_time|default=''}" class="layui-input layui-disabled">
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn layui-btn-normal" lay-submit lay-filter="setting">确认保存</button>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="__static/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script>
    layui.use(['form'], function () {
        var $ = layui.jquery,
            form = layui.form,
            layer = layui.layer;

        //监听提交
        form.on('submit(setting)', function (data) {
            // parent.layer.alert(JSON.stringify(data.field), {
            //     title: '最终的提交信息'
            // });
            var url = '/system/base';
            layer.load(2);
            $.post(url, data.field, function(d) {
                var index = layer.alert(d.msg, '', function() {
                    layer.close(index);
                    // var iframeIndex = parent.layer.getFrameIndex(window.name);
                    // parent.layer.close(iframeIndex);
                });
                layer.closeAll('loading');
            });
            return false;
        });

    });
</script>
</body>
</html>